package com.cycling.app.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.cycling.app.R;
import com.cycling.app.view.CountDownView;

import java.util.Locale;

/**
 * Created by LiZhanPing on 2017/5/6.
 */

public class CheckActivity extends BaseActivity {

    private TextView des;
    private CountDownView countDownView;

    @Override
    public int layoutResId() {
        return R.layout.activity_check;
    }

    @Override
    public void onActivityCreate(@Nullable Bundle savedInstanceState) {
        setTitle(R.string.app_name);

        des = (TextView) findViewById(R.id.tv_des);
        countDownView = (CountDownView) findViewById(R.id.view_count_down);

        des.setText(String.format(Locale.getDefault(), "车牌号 %s 的解锁码", getIntent().getStringExtra("code")));

        countDownView.setOnCountDownFinishListener(new CountDownView.OnCountDownFinishListener() {
            @Override
            public void onFinish() {
                startActivity(new Intent(CheckActivity.this, BillingActivity.class));
                finish();
            }
        });
    }
}
